package java8;

import java.util.Arrays;
import java.util.List;

public class LambdaTest {
    public static void main(String[] args) {
        String[] s = {"l", "a", "m","b", "d", "a"};
//      排序
        Arrays.sort(s, (String s1, String s2) -> (s1.compareTo(s2)));
//      asList用作遍历
        List<String> list = Arrays.asList(s);
        list.forEach(e -> System.out.println( e ) );
//      list.forEach(System.out::println);
    }
}
